package com.google.code.irouter.servlet;

import java.io.IOException;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.google.code.irouter.plugin.bot.SinaWeiboBot;

public final class Bot extends HttpServlet {

	private static final long serialVersionUID = -4166173555553670840L;
	
	@Override
	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws IOException {
		String userId = request.getParameter("userId");
		SinaWeiboBot sinaWeiboBot = new SinaWeiboBot();
		if(userId == null)
			userId = "";
		if(userId.trim().length() > 0) {
			sinaWeiboBot.execute(userId);
		} else {
			sinaWeiboBot.execute();
		}
	}

}
